import java.util.Scanner;

public class demo04 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个整数：");
        int a = scanner.nextInt();
        for (int i=0;i<a;i++){
            System.out.print("*"+" ");
        }System.out.println();
        for (int j=2;j<a;j++){
            System.out.print("*"+" ");
            for (int m=2;m<a;m++) {
                System.out.print("  ");
            }
            System.out.println("*"+" ");
        }
        for (int i=0;i<a;i++){
            System.out.print("*"+" ");
        }
    }
}
